{include file="common/header"}
<link href="/static/admin/css/other.css" rel="stylesheet">
<main class="lyear-layout-content">
    <div class="container-fluid">
        <div class="row ant-menu-submenu">
            <div class="col-lg-10 col-b90">
                <div class="card right-card">
                    <div class="right-card-header card-header">
                        <h4>{:lang('set.problem')}</h4>
                    </div>
                    <div class="card-toolbar clearfix">
                        <div class="toolbar-btn-action">
                            <button class="btn btn-label btn-default" id="add_set_problem">
                                <label>
                                    <i class="iconfont icon-plus-line"></i>
                                </label>{:lang('set.add_problems')}
                            </button>
                        </div>
                    </div>
                    <div class="card-body">
                        <div class="table-responsive">
                            <table class="table table-bordered">
                                <thead>
                                <tr>
                                    <th>{:lang('public.serial_number')}</th>
                                    <th>{:lang('public.ask')}</th>
                                    <th>{:lang('public.keyword')}</th>
                                    <th>{:lang('public.answer')}</th>
                                    <th>{:lang('public.sorting')}</th>
                                    <th>{:lang('set.isshown')}</th>
                                    <th>{:lang('public.operation')}</th>
                                </tr>
                                </thead>
                                <tbody>
                                {foreach $problem_lists as $item}
                                    <tr id="problem-{$item['id']}">
                                        <td>{$item['id']}</td>
                                        <td>{$item['ask']}</td>
                                        <td>{$item['ukeys']}</td>
                                        <td>{:cutstr_html($item['content'],0,40)} ...</td>
                                        <td>{$item['sort']}</td>
                                        <td>{if $item['isshow'] == 1}{:lang('public.show')}{else/}{:lang('public.hidden')}{/if}</td>
                                        <td>
                                            <div class="btn-group">
                                                <a class="btn btn-xs btn-success" href="#!" data-id="{$item['id']}" id="edit_set_problem" data-toggle="tooltip" data-original-title="{:lang('public.editor')}">
                                                    <i class="iconfont icon-xiugai"></i>
                                                </a>
                                                <a class="btn btn-xs btn-success" href="#!" data-id="{$item['id']}" id="del_set_problem" data-toggle="tooltip" data-original-title="{:lang('public.delete')}">
                                                    <i class="iconfont icon-shanchu"></i>
                                                </a>
                                            </div>
                                        </td>
                                    </tr>
                                {/foreach}
                                </tbody>
                            </table>
                        </div>
                        {$problem_lists->render()|raw}
                    </div>
                </div>
            </div>
        </div>
    </div>
</main>
{include file="common/footer"}
<script type="text/javascript">
    let IM_config = {
        addSetProblem: "{:adminUrl('admin/Set/set_problem',['temp'=>'add_set_problem'])}",
        editSetProblem: "{:adminUrl('admin/Set/set_problem',['temp'=>'edit_set_problem'])}",
        delSetProblem: "{:adminUrl('admin/Set/set_problem',['temp'=>'del_set_problem'])}"
    };
</script>
<script type="text/javascript" src="/static/admin/js/set.js"></script>